package com.java.multipledatasource;

import com.java.multipledatasource.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.TimeZone;

/**
 * @author huxb
 * @date 2020/10/18 0018 下午 1:58
 * @Desciption
 */
@SpringBootApplication
@Slf4j
public class Application {
    public static void main(String[] args) {
        TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
        SpringApplication springApplication = new SpringApplication(Application.class);
        springApplication.addListeners((ApplicationListener<ApplicationStartedEvent>) listener -> log.warn("start success!"));
        ConfigurableApplicationContext applicationContext = springApplication.run(args);
        TestService bean = applicationContext.getBean(TestService.class);
//        bean.test();
    }
}
